﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CreateHtml.aspx.cs" Inherits="Crm_CreateHtml" EnableViewState="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>

    <script src="js/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(document).ready(function()
        {
            $("#btnCreateBoards").click(function()
            {
                $.getJSON("/ashx/postop.ashx?ac=creathtmlboard&<%=DateTime.Now %>", function(data)
                {
                    $.each(data, function(i)
                    {
                        var filepath = data[i].linktohtml;
                        //alert(data[i].linkto+"&filehtm="+filepath);
                        $.post(data[i].linkto + "&filehtm=" + filepath, function(res)
                        {
                            $("#info").append("<span>已经生成" + data[i].linktohtml + "</span><br />");
                        });
                    });
                });
            });

            $("#btnCreateArticles").click(function()
            {
                $.getJSON("/ashx/postop.ashx?ac=createarticle&<%=DateTime.Now %>", function(data)
                {
                    $.each(data, function(i)
                    {
                        var filepath = data[i].id;
                        alert(filepath);
                        //                        alert(data[i].addtime);
                        //                        var datetime = data[i].addtime.remove(" ", data[i].addtime.length);
                        //                        $.post("/show.ashx?fn=article_detail&id=" + data[i].id + "&filehtm=~/upload/" + datetime + "/" + data[i].id + ".html", function(res)
                        //                        {
                        //                            //$("#info").append("<span>已经生成" + data[i].linktohtml + "</span><br />");
                        //                        });
                    });
                });
            });
        });
    </script>

</head>
<body>
    <form id="form1" runat="server"> 
    <asp:Button ID="Button2" runat="server" OnClick="Button1_Click" Text="生成首页" />
    <input id="btnCreateBoards"  type="button" value="生成版块页"/>
    <asp:Button ID="btnCreateArticles" runat="server" Text="生成文章" OnClick="btnCreateArticles_Click" /> 
    <div id="info">
    </div>
    <p>
        <asp:Label ID="lblTips" runat="server" ForeColor="#FF3300"></asp:Label>
    </p>
    </form>
    <asp:HyperLink ID="linkpage" runat="server">HyperLink</asp:HyperLink>
</body>
</html>
